package com.makatech.mcs.srv.model.common;

import javax.swing.RowFilter.ComparisonType;

public class Card extends AbstractCard {

	private CardRankEnum rank;
	private CardSuitEnum suit;

	public Card(CardRankEnum rank, CardSuitEnum suit) {
		this.rank = rank;
		this.suit= suit;
	}

	@Override
	public String getShortName() {
		return rank.getShortName().concat(suit.getShortName());
	}

	@Override
	public String getLongName() {
		return rank.getLongName().concat(" of ").concat(suit.getLongName());
	}
	
	public int getValue() {
		return rank.getValue();
	}
	
	public CardRankEnum getRank() {
		return rank;
	}

	public CardSuitEnum getSuit() {
		return suit;
	}
	
	@Override
	public String toString() {
		return getShortName();
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj != null && (obj instanceof Card)) {
			return ((Card)obj).getValue() == this.getValue()
					&& ((Card)obj).getSuit() == this.getSuit();
		}
		return false;
	}
}


